import {
  Controller,
  Get,
  Post,
  Body,
  Query,
  Header,
  UseGuards,
  Request,
} from '@nestjs/common';
import { DepartmentService } from './department.service';
import { AuthGuard } from '@nestjs/passport';

// @UseGuards(AuthGuard('jwt'))
@Controller('department')
export class DepartmentController {
  constructor(private readonly departmentService: DepartmentService) {}
  
  @Get('/getDepartmentList')
  async getDepartmentList(@Query() param) {
    return await this.departmentService.getDepartmentList(param);
  }
  @Post('/getDepartmentTreeList')
  async getDepartmentTreeList(@Body() param) {
    return await this.departmentService.getDepartmentTreeList(param);
  }
  @Get('/getDepartmentTree')
  async getDepartmentTree(@Query() param) {
    return await this.departmentService.getDepartmentTree(param);
  }
  @Get('/getDepartment')
  async getDepartment(@Query() param) {
    return await this.departmentService.getDepartment(param);
  }
  @Post('/saveDepartment')
  async saveDepartment(@Body() param) {
    return await this.departmentService.saveDepartment(param);
  }
    //批量删除角色
    @Post('/delDepartmentList')
    async delDepartmentList(@Body() param) {
      return await this.departmentService.delDepartmentList(param);
    }
}
